#ifndef __EASY_MACHINE_HPP__
#define __EASY_MACHINE_HPP__

#define MACHINE_DELEGATE()

template<typename T>
class EasyMachine
{
protected:
    T m_currentState;

    virtual void enter() = 0;
    virtual void leave() = 0;

public:
    virtual void update(float dt) = 0;

public:
    inline EasyMachine(T state) : m_currentState(state) {}
    
    inline virtual ~EasyMachine() {}

    inline void changeTo(T state)
    {
        if (state != m_currentState)
        {
            leave();
            m_currentState = state;
            enter();
        }
    }

    inline T currentState()
    {
        return m_currentState;
    }
};



#endif
